package github.saw96x.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Saw96x
 * @date 2022/3/17 13:53
 */

@AllArgsConstructor
@Getter
public enum CompressTypeEnum {
  GZIP((byte) 0x01, "gzip");

  private final byte code;
  private final String name;

  public static String getName(byte code) {
    for (CompressTypeEnum c : CompressTypeEnum.values()) {
      if (c.getCode() == code) {
        return c.name;
      }
    }
    return null;
  }
}
